//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public License
// along with this program.  If not, see http://www.gnu.org/licenses/.
// 

#ifndef __SONGSHAN_SOW_FAULT_SW_H_
#define __SONGSHAN_SOW_FAULT_SW_H_

#include <omnetpp.h>
using namespace std;
#include "packet_m.h"

#define NORTH 0
#define SOUTH 1
#define WEST 2
#define EAST 3
#define LOCAL 4

using namespace omnetpp;

/**
 * TODO - Generated class
 */
class SW : public cSimpleModule
{
  protected:
    virtual void initialize() override;
    virtual void handleMessage(cMessage *msg) override;
    int routeMessageXY(Packet *packet_received); // 计算 XY 路由

  private:
    int send_port;
    std::vector<std::vector<int>> routing_table;

};

#endif
